﻿<UserControl
	xmlns="http://schemas.microsoft.com/client/2007"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
	xmlns:sipsorcery="clr-namespace:SIPSorcery;assembly=SIPSorcery" 
	xmlns:sipsorceryui="clr-namespace:SIPSorcery.UIControls;assembly=SIPSorcery" 
	mc:Ignorable="d"
	x:Class="SIPSorcery.DialPlanManager"
	d:DesignWidth="800" d:DesignHeight="480" Width="1024" xmlns:SIPSorcery="clr-namespace:SIPSorcery" OpacityMask="#FF181818" Height="Auto">

	<UserControl.Resources>
		<sipsorcery:DateTimeOffsetConverter x:Key="DateTimeOffsetConverter" />
		<sipsorcery:DateTimeConverter x:Key="DateTimeConverter" />
	</UserControl.Resources>

	<StackPanel Height="Auto" x:Name="m_dialPlansManagerGrid" Width="Auto" Background="#FF000000" ScrollViewer.VerticalScrollBarVisibility="Disabled">
		<sipsorceryui:AssetViewPanel Height="Auto" x:Name="m_dialPlansPanel" Width="Auto" Margin="0,5,0,5">
			<Border BorderBrush="#FFA1FA28" BorderThickness="1,1,1,1" Height="100" x:Name="m_listBorder" Width="1024">
				<data:DataGrid ColumnHeaderHeight="24" SelectionMode="Single" x:Name="m_dialPlansDataGrid" AutoGenerateColumns="False" FontSize="11" 
					RowBackground="Azure"
	            	AlternatingRowBackground="LightSteelBlue" MouseLeftButtonUp="DialPlansDataGrid_MouseLeftButtonUp">
					 <data:DataGrid.Columns>
		                <data:DataGridTextColumn 
		                    Header="Name" 
		                    Width="SizeToCells"
		                    Binding="{Binding DialPlanName}" 
							IsReadOnly="True"
							MinWidth="150"/>
						<data:DataGridTextColumn 
		                    Header="Owner" 
		                    Width="SizeToCells"
		                    Binding="{Binding Owner}" 
							IsReadOnly="True"
							MinWidth="80" />
						<data:DataGridTextColumn 
		                    Header="Type" 
		                    Width="SizeToCells"
		                    Binding="{Binding ScriptTypeDescription}" 
							IsReadOnly="True"
							MinWidth="100"/>
						<data:DataGridTextColumn 
		                    Header="Trace Address" 
		                    Width="SizeToCells"
		                    Binding="{Binding TraceEmailAddress}" 
							IsReadOnly="True"
							MinWidth="150"/>
						<data:DataGridTextColumn 
		                    Header="Read Only" 
		                    Width="SizeToCells"
		                    Binding="{Binding IsReadOnly}" 
							IsReadOnly="True"
							MinWidth="90"/>
						<data:DataGridTextColumn 
							Header="Last Update" 
							Width="SizeToCells"
							Binding="{Binding Path=LastUpdateLocal, Converter={StaticResource DateTimeConverter}}" 
							IsReadOnly="True"
							MinWidth="100" />
						<data:DataGridTemplateColumn Header="Copy" MinWidth="100">
							<data:DataGridTemplateColumn.CellTemplate>
								<DataTemplate>
									<TextBlock Cursor="Hand" Foreground="Purple" Text="copy" TextDecorations="Underline" MouseLeftButtonUp="CopyDialPlan" HorizontalAlignment="Center" />
								</DataTemplate>
							</data:DataGridTemplateColumn.CellTemplate>
						</data:DataGridTemplateColumn>
						<data:DataGridTemplateColumn Header="Delete" MinWidth="100">
							<data:DataGridTemplateColumn.CellTemplate>
								<DataTemplate>
									<TextBlock Cursor="Hand" Foreground="Purple" Text="delete" TextDecorations="Underline" MouseLeftButtonUp="DeleteDialPlan" HorizontalAlignment="Center" />
								</DataTemplate>
							</data:DataGridTemplateColumn.CellTemplate>
						</data:DataGridTemplateColumn>
		 			</data:DataGrid.Columns>
				</data:DataGrid>
			</Border>
		</sipsorceryui:AssetViewPanel>
	</StackPanel>
</UserControl>